<template>
  <div>
<!--    <div>-->
<!--      <el-button>{{ info1 }}</el-button>-->
<!--    </div>-->
<!--    <div>-->
<!--      <el-button>{{ info2 }}</el-button>-->
<!--    </div>-->
    <div v-for="i in info">
      <el-button>{{i.resname}}</el-button>
    </div>
    <div>
      <table v-for="i in list1" border="1">
        <tr>
          <th width="100px">编号</th>
          <th width="100px">内容</th>
          <th width="100px">下一审批人</th>
        </tr>
        <tr>
          <td>{{ i.qid }}</td>
          <td>{{ i.qname }}</td>
          <td @click="tc(i.qid)">
            {{ i.uname }}
          </td>
        </tr>
      </table>
    </div>
    <div>
      <el-dialog
          title="提示"
          :visible.sync="dialogVisible"
          width="30%"
          :before-close="handleClose">
        <span>审核</span>
        <span slot="footer" class="dialog-footer">
    <el-button @click="shenpi">不通过</el-button>
    <el-button type="primary" @click="shenpi2">通过</el-button>
  </span>
      </el-dialog>
    </div>
  </div>
</template>

<script>
export default {
  name: "Myadmin",
  data() {
    return {
      // info1: "",
      // info2: "",
      info:[],
      list1: [],
      // status: 0,
      dialogVisible: false,
      sid:""
    }
  },
  mounted() {
    this.getData()

  },
  methods: {
    tc(id){
      this.dialogVisible=true
      this.sid=id
    },
    handleClose(done) {
      this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {
          });
    },
    shenpi() {
      this.axios.get("shenpi?qid=" + this.sid + "&status=0")
          .then(res => {
            console.log(res)
            this.dialogVisible=false
            this.showdata()
          })
    },
    shenpi2() {
      this.axios.get("shenpi?qid=" + this.sid + "&status=1")
          .then(res => {
            console.log(res)
            this.dialogVisible=false
            this.showdata()
          })
    },
    showdata() {
      var uid = localStorage.getItem("uid")
      this.axios.get("showdata?uid=" + uid)
          .then(res => {
            console.log(res)
            this.list1 = res.data.data

          })
    },
    getData() {
      var uid = localStorage.getItem("uid")
      var rid = localStorage.getItem("rid")
      this.axios.get("data?uid=" + uid + "&rid=" + rid)
          .then(res => {
            console.log(res)
            this.showdata()
            this.info=res.data.res
          })
    },
  }
}
</script>

<style scoped>

</style>
